<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>淘格子，淘分享</title>
<style type="text/css">
<!--
.b1,.b2,.b3,.b4,.b1b,.b2b,.b3b,.b4b,.b{display:block;overflow:hidden;height:450px;}
.b1,.b2,.b3,.b1b,.b2b,.b3b{height:1px;}
.b2,.b3,.b4,.b2b,.b3b,.b4b,.b{border-left:1px solid #999;border-right:1px solid #999;}
.b1,.b1b{margin:0 5px;background:#999;}
.b2,.b2b{margin:0 3px;border-width:2px;}
.b3,.b3b{margin:0 2px;}
.b4,.b4b{height:2px;margin:0 1px;}
.d1{background: #FFFFFF;}
label{text-align:right; width:150px; float:left;}
-->
</style>

</head>
<script  language="javascript">
function agree(sid){
var id = sid.substring(2);

var type  = ($(id+'msgkind').innerHTML).replace("&nbsp;","");  

var id_user = ($(id+'from_id_user').innerHTML).replace("&nbsp;","");

switch(type)
   {
   case 'SalerApply':
     {
	 var urlstr='__APP__/Admin/ajaxGet';
	 var datastr ='pfunc=passSaleAuth&msgid='+id+'&param1='+id_user;
	 var callback = function(data){msg('消息','申请已批准');};
	 ajaxGet(urlstr,datastr,callback);
	 }
     break
   case 'chargeApply':
	   {	
	    var pp2 =window.prompt("人工充值核对","请在此输入核对后的格子数"); 
	   	var urlstr='__APP__/Admin/ajaxGet';
	 	var datastr ='pfunc=checkCharge&msgid='+id+'&param1='+id_user+'&param2='+pp2;
	 	var callback = function(data){msg('消息','申请已批准');};
	 	ajaxGet(urlstr,datastr,callback);
	   }     
     break
   case 'chargeSureApply':
	   {	
	    var pp2 =window.prompt("人工充值核对","请在此输入核对后的保证金金额"); 
	   	var urlstr='__APP__/Admin/ajaxGet';
	 	var datastr ='pfunc=checkSureCharge&msgid='+id+'&param1='+id_user+'&param2='+pp2;
	 	var callback = function(data){msg('消息','充值保证金OK');};
	 	ajaxGet(urlstr,datastr,callback);
	   }     
     break	 
   case 'prjExecApply':
	   {	
	   	var urlstr='__APP__/Prj/checkPrj';
	 	var tmp =($(id+'attach1').innerHTML).replace("&nbsp;","");	
		var ary =tmp.split(':');
		var id_gezi_prj = ary[1];
		var datastr ='?id_gezi_prj='+id_gezi_prj+'&status=tobeCheck';
		$('msglineID').value = id;
		//弹出一个窗口，内容是href的，指向url，携带项目id参数，用户id，查看prjpdtview，得到相关信息，点确认，此项目被批准，修改状态为beiginExec
		popwin(urlstr,datastr);
	   }
     break
   case 'taskPrintApply':
	   {//todo，下面代码copy的，没有调试	
	   	var urlstr='__APP__/Prj/checkPrj';
	 	var tmp =($(id+'attach1').innerHTML).replace("&nbsp;","");	
		var ary =tmp.split(':');
		var id_gezi_prj = ary[1];
		var datastr ='?id_gezi_prj='+id_gezi_prj+'&status=tobeCheck';
		$('msglineID').value = id;
		//弹出一个窗口，内容是href的，指向url，携带项目id参数，用户id，查看prjpdtview，得到相关信息，点确认，此项目被批准，修改状态为beiginExec
		popwin(urlstr,datastr);
	   }
	  break	 		 
   default:
     
   }
}

	function popwin(urlstr,datastr)
	{
	$j('#pop').panel();

	$j('#pop').load(urlstr+datastr);
	$j('#winpop').window('open');
	//
	}
	
	function agreePrj(prjid)
	{
	   	//alert(id);
		var urlstr='__APP__/Admin/ajaxGet';
	 	var datastr ='pfunc=agreePrj&msgid='+$('msglineID').value+'&param1='+prjid;
	 	var callback = function(data)
		{
			if(data[0]['status']=='ok')
			{	
				$j('#winpop').window('close');
				msg('消息：'+data[0]['msg'],'申请已批准');
			}
		};
	 	ajaxGet(urlstr,datastr,callback);
	}
	
	function closewin()
	{
	$j('#winpop').window('close');
	}
</script>
<body style="text-align:center;">
	<if condition="count($dbList) gt 0">
		<div id="rightCt"><h3 style="text-align:center">申请列表</h3></div>
			<table  bgcolor="#e7efff" border="1" style="margin-top:0px; font-size:12;" cellspacing="1" cellpadding="1">
                    <tr>
                        <td bgcolor="#FFD700">id</td>
                        <td bgcolor="#FFD700">消息状态</td>						
                        <td bgcolor="#FFD700">From</td>						
                        <td bgcolor="#FFD700">to</td>
	                    <td bgcolor="#FFD700">附属信息1</td>
                        <td bgcolor="#FFD700">附属信息2</td>						
                        <td bgcolor="#FFD700">附属信息3</td>						
	                    <td bgcolor="#FFD700">附属信息4</td>						
                        <td bgcolor="#FFD700">附属信息5</td>	
                        <td bgcolor="#FFD700">信息正文</td>
                        <td bgcolor="#FFD700">信息类别</td>																																																																	
						<td bgcolor="#FFD700">同意</td>
						<td bgcolor="#FFD700">驳回</td>
                    </tr>
						<div id="list" >
                          <volist name="dbList" id="vo">
                            <tr id="{$vo.id_gezi_msg}" onMouseOver="this.style.backgroundColor='#f7f7f7'"
							onmouseout="this.style.backgroundColor='transparent'" >
							  <td id="{$vo.id_gezi_msg}">{$vo.id_gezi_msg}&nbsp;</td>
                              <td id="{$vo.id_gezi_msg}status">{$vo.status}&nbsp;</td>							  
                              <td id="{$vo.id_gezi_msg}from_id_user">{$vo.from_id_user}&nbsp;</td>							  
                              <td id="{$vo.id_gezi_msg}to">{$vo.target}&nbsp;</td>
                              <td id="{$vo.id_gezi_msg}attach1">{$vo.attach1}&nbsp;</td>
                              <td id="{$vo.id_gezi_msg}attach2">{$vo.attach2}&nbsp;</td>							  							  
                              <td id="{$vo.id_gezi_msg}attach3">{$vo.attach3}&nbsp;</td>							  
                              <td id="{$vo.id_gezi_msg}attach4">{$vo.attach4}&nbsp;</td>							  
                              <td id="{$vo.id_gezi_msg}attach5">{$vo.attach5}&nbsp;</td>							  
                              <td id="{$vo.id_gezi_msg}msg">{$vo.msg}&nbsp;</td>			
                              <td id="{$vo.id_gezi_msg}msgkind">{$vo.msgkind}&nbsp;</td>	
                              <td id="ag{$vo.id_gezi_msg}" onClick="agree(this.id)"><img src="__PUBLIC__/Images/edit.ico" alt="同意申请"/></td>
                              <td id="rj{$vo.id_gezi_msg}" onClick="reject(this.id)"><img src="__PUBLIC__/Images/edit.ico" alt="驳回申请"/></td>	
                            </tr>
                          </volist>

                        </div>
					<tr>
                    <td align="center" colspan="13">		
					<?php
					if(isset($page)) echo $page;		
					?>	</td>
                    </tr>
		  	</table>
		<!--数据集显示结束-->
		</div>		
		</if>
	<div id="winpop" class="easyui-window"  closed="true" title="Pop" style="width:650px;height:600px;">
	<div id="pop" title="My Panel" collapsible="true"  style="padding:10px;width:635px;height:450px">
	  Panel Content
	</div>
			<input type="hidden"  id="msglineID" value=""/>	            
			<a href="javascript:agreePrj($('id_gezi_prj').value)" class="easyui-linkbutton" icon="icon-ok">Ok</a>
            <a href="javascript:void(0)" onClick="closewin();" class="easyui-linkbutton" icon="icon-cancel">Cancel</a>

	</div>

	
</body>